//  Problem code: RESN04

#include <cstdio>

int cases, N;
int stone[105];
const int ALICE = 1;

void input() {
    scanf("%d", &N);
    for(int i = 1; i <= N; ++i) {
        scanf("%d", &stone[i]);
    }
}

int cal() {
    int j = 0;
    for(int i = 1; i <= N; ++i) {
        j += stone[i] / i;
    }
    return (j % 2);
}

void output() {
    if(cal() == ALICE) {
        puts("ALICE");
    } else {
        puts("BOB");
    }
}

int main() {
    scanf("%d", &cases);
    while(cases--) {
        input();
        output();
    }
    return 0;
}
